package com.ggambo.HandCoin;

import com.ggambo.HandCoin.Advertising.Advertising_List;

import android.app.AlertDialog;
import android.app.TabActivity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Window;
import android.widget.TabHost;


public class HandCoin extends TabActivity
{
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        Window win = getWindow();
        win.requestFeature(Window.FEATURE_CUSTOM_TITLE);


        TabHost mTab = getTabHost();
        startActivity(new Intent(this , SplashActivity.class));

        LayoutInflater inflater = LayoutInflater.from(this);
        inflater.inflate(R.layout.main , mTab.getTabContentView() , true);

        mTab.addTab(mTab.newTabSpec("tab1").setIndicator("광고목록").setContent(new Intent(this , Advertising_List.class)));
//        mTab.addTab(mTab.newTabSpec("tab1").setIndicator("광고목록").setContent(R.id.first_item));
        mTab.addTab(mTab.newTabSpec("tab2").setIndicator("TIP").setContent(R.id.second_item));
        mTab.addTab(mTab.newTabSpec("tab3").setIndicator("환전소").setContent(R.id.third_item));
        mTab.addTab(mTab.newTabSpec("tab4").setIndicator("마이페이지").setContent(R.id.forth_item));

        win.setFeatureInt(Window.FEATURE_CUSTOM_TITLE , R.layout.title);
    }

    @Override
    public void onBackPressed()
    {
        AlertDialog.Builder ad = new AlertDialog.Builder(this);
        ad.setTitle("종료");
        ad.setMessage("종료할래요?");
        ad.setNegativeButton("No" , null);
        ad.setPositiveButton("Yes", new OnClickListener() {
			
			public void onClick(DialogInterface dialog, int which) {
				// TODO Auto-generated method stub
				moveTaskToBack(true);
				finish();
			}
		});
        ad.show();
    }

}
